
<DOCTYPE html>
<html>
<head>
    <title>团购历史</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php foreach ($this->config->item('style_css_paths') as $css): ?>
      <link rel="stylesheet" href=<?php echo $css ?> />
    <?php endforeach ?>
    <?php foreach ($this->config->item('style_js_paths') as $js): ?>
      <script type="text/javascript" src=<?php echo $js?> ></script>
    <?php endforeach ?>
</head>
<body>

   <div data-role="page" id="grouphistory"> 
        <div data-role="header" data-tap-toggle="false" data-theme="a"  data-position="fixed">
            <!-- <h1>我的订单</h1> -->
            <div data-role="navbar">
                <ul>
                    <li><a href=<?php echo site_url('welcome/history') ;?> class="ui-btn-icon-right ui-icon-shop">外卖历史</a></li>
                    <li><a href=<?php echo site_url('grouppurchase/history'); ?> class="ui-btn-active ui-btn-icon-right ui-icon-grid">团购历史</a></li>
                </ul>
            </div><!-- /navbar -->
        </div>
        <div role="main" class="ui-content">
            <ul data-role="listview" data-inset="true">
                <ul data-role="listview" data-inset="true">
                    <li data-role="divider">团购历史</li>
                    <?php foreach ($history_bills as $item): ?>
                      <li>
                          <a href=<?php echo site_url('grouppurchase/historyBill?group_bill_id=') . $item["group_bill_id"] ; ?>>
                              <!-- <img src="<?php echo base_url($item["logo_pic"]); ?>"/> -->
                              <h2><?php echo $item["group_name"];?></h2>
                              <p class="ui-li-aside"><strong><?php echo $item['bill_time'];?></strong></p>
                              <p>截止日期: <?php echo $item['use_deadline'];?></p>
                          </a>
                      </li>
                    <?php endforeach ?>
                    </ul>
            </ul>
            <div data-role="controlgroup" style = "float: right" data-type="horizontal" class="ui-mini">
                <?php 
                    $page_num = $this->input->get("page_num", true);
                    $echo_string = "";
                    if ($page_num == "")
                        $page_num = 1;
                    if ($page_num == 1)
                    {
                        $echo_string = '<a class="ui-btn ui-btn-icon-right ui-icon-star">第1页</a>';
                    }
                    else
                    {
                        $last_page = $page_num-1;
                        $last_page = site_url('grouppurchase/history?page_num=') . $last_page;
                        $echo_string = '<a href="' . $last_page 
                                        . '" class="ui-btn ui-btn-icon-right ui-icon-arrow-u">上一页</a>';
                        $echo_string = $echo_string . '<a class="ui-btn ui-btn-icon-right ui-icon-star">第'
                                        . $page_num . '页</a>';
                    }
                    if ($page_num*$per_page<$total_rows)
                    {
                        $next_page = $page_num+1;
                        $next_page = site_url('grouppurchase/history?page_num=') . $next_page;
                        $echo_string = $echo_string . '<a href="' . $next_page
                                        . '" class="ui-btn ui-btn-icon-right ui-icon-arrow-d">下一页</a>';
                    }
                    echo $echo_string;
                ?>
            </div>
        </div>   
        <div data-role="footer" data-tap-toggle="false" data-position="fixed">
            <div data-role="navbar">
              <ul>
                <li><a href=<?php echo site_url('welcome');?> data-icon="home">主页</a></li>
                <li><a href=<?php echo site_url("welcome/shop") ;?> data-icon="shop" >店铺</a></li>
                <li><a href=<?php echo site_url('welcome/history');?>  data-icon="check" class="ui-btn-active ui-state-persist">历史订单</a></li>
                <li><a href=<?php echo site_url("welcome/info") ;?> data-icon="info">个人信息</a></li>
              </ul>
            </div>
        </div>
    </div> 
    
</body>
</html>